Add an ostree-tests package, and use it for autopkgtest
authorSimon McVittie <smcv@debian.org>
Fri, 29 Jan 2016 10:23:42 +0000 (11:23 +0100)
committerSimon McVittie <smcv@debian.org>
Fri, 29 Jan 2016 10:42:05 +0000 (11:42 +0100)
debian/changelog
debian/control
debian/ostree-tests.install [new file with mode: 0644]
debian/rules
debian/tests/build [new file with mode: 0755]
debian/tests/control [new file with mode: 0644]
debian/tests/gnome-desktop-testing [new file with mode: 0755]

index 63e6aaf4affcde25d5a8ed0ce0ea62ca87397102..3f4f10abe851b92bdd048f4e7708fad4e6bcc5f1 100644 (file)
@@ -14,6 +14,7 @@ ostree (2016.1-1) UNRELEASED; urgency=medium
   * Use dh_install --fail-missing to catch mistakes
   * Add a symbols file
   * Add missing dependency on libglib2.0-dev
+  * Add an ostree-tests package, and use it for autopkgtest
 
  -- Simon McVittie <smcv@debian.org>  Wed, 27 Jan 2016 13:04:34 +0100
 
index eacbbeb4a8826dfcf02e3091542e76a805cd69c2..f2fba538dbe84149ed6b9c4e23932dec2a2b2d7a 100644 (file)
@@ -123,3 +123,23 @@ Description: GRUB 2 configuration for ostree
  disadvantages) of both.
  .
  This package contains configuration snippets for using ostree with GRUB 2.
+
+Package: ostree-tests
+Architecture: any
+Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
+ attr,
+ ca-certificates,
+ gir1.2-gsystem-1.0,
+ gir1.2-ostree-1.0,
+ gjs,
+ ostree,
+ python,
+Description: content-addressed filesystem for operating system binaries - tests
+ OSTree is a tool for managing bootable, immutable, versioned filesystem trees.
+ It is not a package system; nor is it a tool for managing full disk images.
+ Instead, it sits between those levels, offering a blend of the advantages (and
+ disadvantages) of both.
+ .
+ This package contains automated tests.
diff --git a/debian/ostree-tests.install b/debian/ostree-tests.install
new file mode 100644 (file)
index 0000000..2c3436b
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/*/ostree/installed-tests
+usr/share/installed-tests/ostree
index 53cc4a1c8bba8b53dac31e7671cc2c29ac58f132..18ad63d9a3c0779eae1e1d6633cfca6bb298e436 100755 (executable)
@@ -15,11 +15,20 @@ override_dh_auto_configure:
        dh_auto_configure -- \
                --disable-silent-rules \
                --enable-gtk-doc \
+               --enable-installed-tests \
                --with-dracut \
                --with-grub2 \
                --with-systemdsystemunitdir=/lib/systemd/system \
                $(NULL)
+       chmod +x tests/*.js
 
 override_dh_install:
        rm -f debian/tmp/usr/lib/*/*.la
+       rm -f debian/tmp/usr/lib/*/ostree/installed-tests/*.la
        dh_install --fail-missing
+
+override_dh_fixperms:
+       dh_fixperms -X'*.js'
+       chmod -v +x debian/tmp/usr/lib/*/ostree/installed-tests/*.js
+       chmod -v +x debian/tmp/usr/lib/*/ostree/installed-tests/*.py
+       chmod -v +x debian/tmp/usr/lib/*/ostree/installed-tests/*.sh
diff --git a/debian/tests/build b/debian/tests/build
new file mode 100755 (executable)
index 0000000..594e4f7
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+exec 2>&1
+set -x
+
+cd "$ADTTMP"
+
+cat > trivial.c <<EOF
+#include <ostree.h>
+
+int main (void)
+{
+    g_object_unref (ostree_repo_new_default ());
+    return 0;
+}
+EOF
+
+gcc -o trivial trivial.c $(pkg-config --cflags --libs ostree-1 gobject-2.0)
+test -x trivial
+./trivial
+echo "ok 3 run it"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644 (file)
index 0000000..88ffde7
--- /dev/null
@@ -0,0 +1,5 @@
+Tests: gnome-desktop-testing
+Depends: gnome-desktop-testing, ostree-tests
+
+Tests: build
+Depends: build-essential, libostree-dev, pkg-config
diff --git a/debian/tests/gnome-desktop-testing b/debian/tests/gnome-desktop-testing
new file mode 100755 (executable)
index 0000000..e3015cc
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+exec 2>&1
+
+exec gnome-desktop-testing-runner ostree